Correctly upload textures for GLES
authorAlexander Larsson <alexl@redhat.com>
Thu, 24 Sep 2020 13:03:48 +0000 (15:03 +0200)
committerAlexander Larsson <alexl@redhat.com>
Fri, 25 Sep 2020 07:31:43 +0000 (09:31 +0200)
commit1001995d496573072171ed2200fa0c470ffac476
treed3afa0f084a29dab769e073b7552221d3aa2f736
parent8e59cdabac9596acd2d2bc502ae583f321f4f4d1
Correctly upload textures for GLES

GLES doesn't support the GL_BGRA +  GL_UNSIGNED_INT_24_8 hack that
we use on desktop OpenGL to upload textures directly in the cairo
pixel format. This adds the required conversions to all the places
that currently need it.

We also add a data_format to the internal gdk_gl_context_upload_texture()
function to make it clearer what the format are. Currently it is always
the cairo image surface format, but eventually we want to support other
formats so that we can avoid some of the unnecessary conversions we do.

Also, the current gdk_gl_context_upload_texture() code always converts
to a cairo format and uploads that like we did before. Later commits
will allow this to use other upload formats that gl supports to avoid
conversions.
gdk/gdkgl.c
gdk/gdkglcontext.c
gdk/gdkglcontextprivate.h
gsk/gl/gskglglyphcache.c
gsk/gl/gskgliconcache.c